import torch as pt
from python_ai.common.xcommon import *

pt.set_printoptions(edgeitems=100)

sep('3x4')
x = pt.arange(1, 3*4+1).view(3, 4)
print(x)

x2 = x.clone()
x2 *= 10
print(x2)

sep('scatter dim=1 (meaningful)')
g = x.scatter_(1, pt.Tensor([[0, 1, 2], [2, 1, 0], [3, 2, 1]]).long(), x2)
print(g)
